package soccerBet.project.dao;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;
import soccerBet.project.objects.*;
import soccerBet.project.utils.*;

public class DestinatariosDAO {


	
	public List<Destinatarios> getAllDestinatarios() {

		Session session = HibernateUtil.getSessionFactory().openSession();
		
		List<Destinatarios> destinatariosList = (List<Destinatarios>)  session.
		createQuery("select d from Destinatarios as d where d.estado = 1").list();
		
		
		session.close();
		
		return destinatariosList;

	}
	
	public List<Destinatarios> 	getDestinatariosPermissoes() {

		Session session = HibernateUtil.getSessionFactory().openSession();
		
		List<Destinatarios> destinatariosList = (List<Destinatarios>)  session.
		createQuery("select d from Destinatarios as d where d.permissao = 1 and d.estado = 1").list();
		
		
		session.close();
		
		return destinatariosList;

	} 



}